3.3.45 \(\int (a+a \sin (e+f x)) (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx\) [245]

Optimal. Leaf size=213 \[ \frac {1}{8} a \left (4 A \left (2 c^2+2 c d+d^2\right )+B \left (4 c^2+8 c d+3 d^2\right )\right ) x-\frac {a \left (4 A d \left (c^2+3 c d+d^2\right )-B \left (c^3-4 c^2 d-8 c d^2-4 d^3\right )\right ) \cos (e+f x)}{6 d f}-\frac {a \left (3 (4 A+3 B) d^2-2 c (B c-4 (A+B) d)\right ) \cos (e+f x) \sin (e+f x)}{24 f}+\frac {a (B c-4 (A+B) d) \cos (e+f x) (c+d \sin (e+f x))^2}{12 d f}-\frac {a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f} \]

[Out]

1/8*a*(4*A*(2*c^2+2*c*d+d^2)+B*(4*c^2+8*c*d+3*d^2))*x-1/6*a*(4*A*d*(c^2+3*c*d+d^2)-B*(c^3-4*c^2*d-8*c*d^2-4*d^
3))*cos(f*x+e)/d/f-1/24*a*(3*(4*A+3*B)*d^2-2*c*(B*c-4*(A+B)*d))*cos(f*x+e)*sin(f*x+e)/f+1/12*a*(B*c-4*(A+B)*d)
*cos(f*x+e)*(c+d*sin(f*x+e))^2/d/f-1/4*a*B*cos(f*x+e)*(c+d*sin(f*x+e))^3/d/f

________________________________________________________________________________________

Rubi [A]
time = 0.25, antiderivative size = 213, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {3047, 3102, 2832, 2813} \begin {gather*} \frac {a \left (-8 c d (A+B)-3 d^2 (4 A+3 B)+2 B c^2\right ) \sin (e+f x) \cos (e+f x)}{24 f}+\frac {1}{8} a x \left (4 A \left (2 c^2+2 c d+d^2\right )+B \left (4 c^2+8 c d+3 d^2\right )\right )-\frac {a \left (4 A d \left (c^2+3 c d+d^2\right )-B \left (c^3-4 c^2 d-8 c d^2-4 d^3\right )\right ) \cos (e+f x)}{6 d f}+\frac {a (B c-4 d (A+B)) \cos (e+f x) (c+d \sin (e+f x))^2}{12 d f}-\frac {a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[e + f*x])*(A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2,x]

[Out]

(a*(4*A*(2*c^2 + 2*c*d + d^2) + B*(4*c^2 + 8*c*d + 3*d^2))*x)/8 - (a*(4*A*d*(c^2 + 3*c*d + d^2) - B*(c^3 - 4*c
^2*d - 8*c*d^2 - 4*d^3))*Cos[e + f*x])/(6*d*f) + (a*(2*B*c^2 - 8*(A + B)*c*d - 3*(4*A + 3*B)*d^2)*Cos[e + f*x]
*Sin[e + f*x])/(24*f) + (a*(B*c - 4*(A + B)*d)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(12*d*f) - (a*B*Cos[e + f*
x]*(c + d*Sin[e + f*x])^3)/(4*d*f)

Rule 2813

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(2*a*c +
 b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Cos[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rule 2832

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d
)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(f*(m + 1))), x] + Dist[1/(m + 1), Int[(a + b*Sin[e + f*x])^(m - 1)*Sim
p[b*d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]

Rule 3047

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x
]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]

Rule 3102

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(
b*(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x],
x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rubi steps

\begin {align*} \int (a+a \sin (e+f x)) (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx &=\int (c+d \sin (e+f x))^2 \left (a A+(a A+a B) \sin (e+f x)+a B \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}+\frac {\int (c+d \sin (e+f x))^2 (a (4 A+3 B) d-a (B c-4 (A+B) d) \sin (e+f x)) \, dx}{4 d}\\ &=\frac {a (B c-4 (A+B) d) \cos (e+f x) (c+d \sin (e+f x))^2}{12 d f}-\frac {a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}+\frac {\int (c+d \sin (e+f x)) \left (a d (12 A c+7 B c+8 A d+8 B d)-a \left (2 B c^2-8 (A+B) c d-3 (4 A+3 B) d^2\right ) \sin (e+f x)\right ) \, dx}{12 d}\\ &=\frac {1}{8} a \left (4 A \left (2 c^2+2 c d+d^2\right )+B \left (4 c^2+8 c d+3 d^2\right )\right ) x-\frac {a \left (4 A d \left (c^2+3 c d+d^2\right )-B \left (c^3-4 c^2 d-8 c d^2-4 d^3\right )\right ) \cos (e+f x)}{6 d f}+\frac {a \left (2 B c^2-8 (A+B) c d-3 (4 A+3 B) d^2\right ) \cos (e+f x) \sin (e+f x)}{24 f}+\frac {a (B c-4 (A+B) d) \cos (e+f x) (c+d \sin (e+f x))^2}{12 d f}-\frac {a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.07, size = 185, normalized size = 0.87 \begin {gather*} \frac {a (1+\sin (e+f x)) \left (-24 \left (B \left (4 c^2+6 c d+3 d^2\right )+A \left (4 c^2+8 c d+3 d^2\right )\right ) \cos (e+f x)+8 d (A d+B (2 c+d)) \cos (3 (e+f x))+3 \left (4 \left (4 A \left (2 c^2+2 c d+d^2\right )+B \left (4 c^2+8 c d+3 d^2\right )\right ) f x-8 \left (B (c+d)^2+A d (2 c+d)\right ) \sin (2 (e+f x))+B d^2 \sin (4 (e+f x))\right )\right )}{96 f \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[e + f*x])*(A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2,x]

[Out]

(a*(1 + Sin[e + f*x])*(-24*(B*(4*c^2 + 6*c*d + 3*d^2) + A*(4*c^2 + 8*c*d + 3*d^2))*Cos[e + f*x] + 8*d*(A*d + B
*(2*c + d))*Cos[3*(e + f*x)] + 3*(4*(4*A*(2*c^2 + 2*c*d + d^2) + B*(4*c^2 + 8*c*d + 3*d^2))*f*x - 8*(B*(c + d)
^2 + A*d*(2*c + d))*Sin[2*(e + f*x)] + B*d^2*Sin[4*(e + f*x)])))/(96*f*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2
)

________________________________________________________________________________________

Maple [A]
time = 0.19, size = 274, normalized size = 1.29 Too large to display

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(A*c^2*a*(f*x+e)-2*A*c*d*a*cos(f*x+e)+A*d^2*a*(-1/2*cos(f*x+e)*sin(f*x+e)+1/2*f*x+1/2*e)-B*c^2*a*cos(f*x+e
)+2*B*c*d*a*(-1/2*cos(f*x+e)*sin(f*x+e)+1/2*f*x+1/2*e)-1/3*B*d^2*a*(2+sin(f*x+e)^2)*cos(f*x+e)-A*c^2*a*cos(f*x
+e)+2*A*c*d*a*(-1/2*cos(f*x+e)*sin(f*x+e)+1/2*f*x+1/2*e)-1/3*A*d^2*a*(2+sin(f*x+e)^2)*cos(f*x+e)+B*c^2*a*(-1/2
*cos(f*x+e)*sin(f*x+e)+1/2*f*x+1/2*e)-2/3*B*c*d*a*(2+sin(f*x+e)^2)*cos(f*x+e)+B*d^2*a*(-1/4*(sin(f*x+e)^3+3/2*
sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 285, normalized size = 1.34 \begin {gather*} \frac {96 \, {\left (f x + e\right )} A a c^{2} + 24 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} B a c^{2} + 48 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} A a c d + 64 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} B a c d + 48 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} B a c d + 32 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} A a d^{2} + 24 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} A a d^{2} + 32 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} B a d^{2} + 3 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} B a d^{2} - 96 \, A a c^{2} \cos \left (f x + e\right ) - 96 \, B a c^{2} \cos \left (f x + e\right ) - 192 \, A a c d \cos \left (f x + e\right )}{96 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

1/96*(96*(f*x + e)*A*a*c^2 + 24*(2*f*x + 2*e - sin(2*f*x + 2*e))*B*a*c^2 + 48*(2*f*x + 2*e - sin(2*f*x + 2*e))
*A*a*c*d + 64*(cos(f*x + e)^3 - 3*cos(f*x + e))*B*a*c*d + 48*(2*f*x + 2*e - sin(2*f*x + 2*e))*B*a*c*d + 32*(co
s(f*x + e)^3 - 3*cos(f*x + e))*A*a*d^2 + 24*(2*f*x + 2*e - sin(2*f*x + 2*e))*A*a*d^2 + 32*(cos(f*x + e)^3 - 3*
cos(f*x + e))*B*a*d^2 + 3*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*e))*B*a*d^2 - 96*A*a*c^2*cos(f*x
 + e) - 96*B*a*c^2*cos(f*x + e) - 192*A*a*c*d*cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 165, normalized size = 0.77 \begin {gather*} \frac {8 \, {\left (2 \, B a c d + {\left (A + B\right )} a d^{2}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (4 \, {\left (2 \, A + B\right )} a c^{2} + 8 \, {\left (A + B\right )} a c d + {\left (4 \, A + 3 \, B\right )} a d^{2}\right )} f x - 24 \, {\left ({\left (A + B\right )} a c^{2} + 2 \, {\left (A + B\right )} a c d + {\left (A + B\right )} a d^{2}\right )} \cos \left (f x + e\right ) + 3 \, {\left (2 \, B a d^{2} \cos \left (f x + e\right )^{3} - {\left (4 \, B a c^{2} + 8 \, {\left (A + B\right )} a c d + {\left (4 \, A + 5 \, B\right )} a d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{24 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

1/24*(8*(2*B*a*c*d + (A + B)*a*d^2)*cos(f*x + e)^3 + 3*(4*(2*A + B)*a*c^2 + 8*(A + B)*a*c*d + (4*A + 3*B)*a*d^
2)*f*x - 24*((A + B)*a*c^2 + 2*(A + B)*a*c*d + (A + B)*a*d^2)*cos(f*x + e) + 3*(2*B*a*d^2*cos(f*x + e)^3 - (4*
B*a*c^2 + 8*(A + B)*a*c*d + (4*A + 5*B)*a*d^2)*cos(f*x + e))*sin(f*x + e))/f

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 571 vs. \(2 (201) = 402\).
time = 0.28, size = 571, normalized size = 2.68 \begin {gather*} \begin {cases} A a c^{2} x - \frac {A a c^{2} \cos {\left (e + f x \right )}}{f} + A a c d x \sin ^{2}{\left (e + f x \right )} + A a c d x \cos ^{2}{\left (e + f x \right )} - \frac {A a c d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 A a c d \cos {\left (e + f x \right )}}{f} + \frac {A a d^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {A a d^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {A a d^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {A a d^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {2 A a d^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac {B a c^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {B a c^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {B a c^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {B a c^{2} \cos {\left (e + f x \right )}}{f} + B a c d x \sin ^{2}{\left (e + f x \right )} + B a c d x \cos ^{2}{\left (e + f x \right )} - \frac {2 B a c d \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {B a c d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 B a c d \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac {3 B a d^{2} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {3 B a d^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {3 B a d^{2} x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {5 B a d^{2} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {B a d^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {3 B a d^{2} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} - \frac {2 B a d^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} & \text {for}\: f \neq 0 \\x \left (A + B \sin {\left (e \right )}\right ) \left (c + d \sin {\left (e \right )}\right )^{2} \left (a \sin {\left (e \right )} + a\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))**2,x)

[Out]

Piecewise((A*a*c**2*x - A*a*c**2*cos(e + f*x)/f + A*a*c*d*x*sin(e + f*x)**2 + A*a*c*d*x*cos(e + f*x)**2 - A*a*
c*d*sin(e + f*x)*cos(e + f*x)/f - 2*A*a*c*d*cos(e + f*x)/f + A*a*d**2*x*sin(e + f*x)**2/2 + A*a*d**2*x*cos(e +
 f*x)**2/2 - A*a*d**2*sin(e + f*x)**2*cos(e + f*x)/f - A*a*d**2*sin(e + f*x)*cos(e + f*x)/(2*f) - 2*A*a*d**2*c
os(e + f*x)**3/(3*f) + B*a*c**2*x*sin(e + f*x)**2/2 + B*a*c**2*x*cos(e + f*x)**2/2 - B*a*c**2*sin(e + f*x)*cos
(e + f*x)/(2*f) - B*a*c**2*cos(e + f*x)/f + B*a*c*d*x*sin(e + f*x)**2 + B*a*c*d*x*cos(e + f*x)**2 - 2*B*a*c*d*
sin(e + f*x)**2*cos(e + f*x)/f - B*a*c*d*sin(e + f*x)*cos(e + f*x)/f - 4*B*a*c*d*cos(e + f*x)**3/(3*f) + 3*B*a
*d**2*x*sin(e + f*x)**4/8 + 3*B*a*d**2*x*sin(e + f*x)**2*cos(e + f*x)**2/4 + 3*B*a*d**2*x*cos(e + f*x)**4/8 -
5*B*a*d**2*sin(e + f*x)**3*cos(e + f*x)/(8*f) - B*a*d**2*sin(e + f*x)**2*cos(e + f*x)/f - 3*B*a*d**2*sin(e + f
*x)*cos(e + f*x)**3/(8*f) - 2*B*a*d**2*cos(e + f*x)**3/(3*f), Ne(f, 0)), (x*(A + B*sin(e))*(c + d*sin(e))**2*(
a*sin(e) + a), True))

________________________________________________________________________________________

Giac [A]
time = 0.53, size = 198, normalized size = 0.93 \begin {gather*} \frac {B a d^{2} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} + \frac {1}{8} \, {\left (8 \, A a c^{2} + 4 \, B a c^{2} + 8 \, A a c d + 8 \, B a c d + 4 \, A a d^{2} + 3 \, B a d^{2}\right )} x + \frac {{\left (2 \, B a c d + A a d^{2} + B a d^{2}\right )} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {{\left (4 \, A a c^{2} + 4 \, B a c^{2} + 8 \, A a c d + 6 \, B a c d + 3 \, A a d^{2} + 3 \, B a d^{2}\right )} \cos \left (f x + e\right )}{4 \, f} - \frac {{\left (B a c^{2} + 2 \, A a c d + 2 \, B a c d + A a d^{2} + B a d^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algorithm="giac")

[Out]

1/32*B*a*d^2*sin(4*f*x + 4*e)/f + 1/8*(8*A*a*c^2 + 4*B*a*c^2 + 8*A*a*c*d + 8*B*a*c*d + 4*A*a*d^2 + 3*B*a*d^2)*
x + 1/12*(2*B*a*c*d + A*a*d^2 + B*a*d^2)*cos(3*f*x + 3*e)/f - 1/4*(4*A*a*c^2 + 4*B*a*c^2 + 8*A*a*c*d + 6*B*a*c
*d + 3*A*a*d^2 + 3*B*a*d^2)*cos(f*x + e)/f - 1/4*(B*a*c^2 + 2*A*a*c*d + 2*B*a*c*d + A*a*d^2 + B*a*d^2)*sin(2*f
*x + 2*e)/f

________________________________________________________________________________________

Mupad [B]
time = 15.41, size = 547, normalized size = 2.57 \begin {gather*} \frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (8\,A\,c^2+4\,A\,d^2+4\,B\,c^2+3\,B\,d^2+8\,A\,c\,d+8\,B\,c\,d\right )}{4\,\left (2\,A\,a\,c^2+A\,a\,d^2+B\,a\,c^2+\frac {3\,B\,a\,d^2}{4}+2\,A\,a\,c\,d+2\,B\,a\,c\,d\right )}\right )\,\left (8\,A\,c^2+4\,A\,d^2+4\,B\,c^2+3\,B\,d^2+8\,A\,c\,d+8\,B\,c\,d\right )}{4\,f}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6\,\left (2\,A\,a\,c^2+2\,B\,a\,c^2+4\,A\,a\,c\,d\right )+\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (A\,a\,d^2+B\,a\,c^2+\frac {3\,B\,a\,d^2}{4}+2\,A\,a\,c\,d+2\,B\,a\,c\,d\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (6\,A\,a\,c^2+4\,A\,a\,d^2+6\,B\,a\,c^2+4\,B\,a\,d^2+12\,A\,a\,c\,d+8\,B\,a\,c\,d\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (6\,A\,a\,c^2+\frac {16\,A\,a\,d^2}{3}+6\,B\,a\,c^2+\frac {16\,B\,a\,d^2}{3}+12\,A\,a\,c\,d+\frac {32\,B\,a\,c\,d}{3}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7\,\left (A\,a\,d^2+B\,a\,c^2+\frac {3\,B\,a\,d^2}{4}+2\,A\,a\,c\,d+2\,B\,a\,c\,d\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (A\,a\,d^2+B\,a\,c^2+\frac {11\,B\,a\,d^2}{4}+2\,A\,a\,c\,d+2\,B\,a\,c\,d\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5\,\left (A\,a\,d^2+B\,a\,c^2+\frac {11\,B\,a\,d^2}{4}+2\,A\,a\,c\,d+2\,B\,a\,c\,d\right )+2\,A\,a\,c^2+\frac {4\,A\,a\,d^2}{3}+2\,B\,a\,c^2+\frac {4\,B\,a\,d^2}{3}+4\,A\,a\,c\,d+\frac {8\,B\,a\,c\,d}{3}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*sin(e + f*x))*(a + a*sin(e + f*x))*(c + d*sin(e + f*x))^2,x)

[Out]

(a*atan((a*tan(e/2 + (f*x)/2)*(8*A*c^2 + 4*A*d^2 + 4*B*c^2 + 3*B*d^2 + 8*A*c*d + 8*B*c*d))/(4*(2*A*a*c^2 + A*a
*d^2 + B*a*c^2 + (3*B*a*d^2)/4 + 2*A*a*c*d + 2*B*a*c*d)))*(8*A*c^2 + 4*A*d^2 + 4*B*c^2 + 3*B*d^2 + 8*A*c*d + 8
*B*c*d))/(4*f) - (tan(e/2 + (f*x)/2)^6*(2*A*a*c^2 + 2*B*a*c^2 + 4*A*a*c*d) + tan(e/2 + (f*x)/2)*(A*a*d^2 + B*a
*c^2 + (3*B*a*d^2)/4 + 2*A*a*c*d + 2*B*a*c*d) + tan(e/2 + (f*x)/2)^4*(6*A*a*c^2 + 4*A*a*d^2 + 6*B*a*c^2 + 4*B*
a*d^2 + 12*A*a*c*d + 8*B*a*c*d) + tan(e/2 + (f*x)/2)^2*(6*A*a*c^2 + (16*A*a*d^2)/3 + 6*B*a*c^2 + (16*B*a*d^2)/
3 + 12*A*a*c*d + (32*B*a*c*d)/3) - tan(e/2 + (f*x)/2)^7*(A*a*d^2 + B*a*c^2 + (3*B*a*d^2)/4 + 2*A*a*c*d + 2*B*a
*c*d) + tan(e/2 + (f*x)/2)^3*(A*a*d^2 + B*a*c^2 + (11*B*a*d^2)/4 + 2*A*a*c*d + 2*B*a*c*d) - tan(e/2 + (f*x)/2)
^5*(A*a*d^2 + B*a*c^2 + (11*B*a*d^2)/4 + 2*A*a*c*d + 2*B*a*c*d) + 2*A*a*c^2 + (4*A*a*d^2)/3 + 2*B*a*c^2 + (4*B
*a*d^2)/3 + 4*A*a*c*d + (8*B*a*c*d)/3)/(f*(4*tan(e/2 + (f*x)/2)^2 + 6*tan(e/2 + (f*x)/2)^4 + 4*tan(e/2 + (f*x)
/2)^6 + tan(e/2 + (f*x)/2)^8 + 1))

________________________________________________________________________________________